vLastImmolateGUID = nil
function ccR_Warlock_Immolate()
	if ccrPlayerHasSpell(IMMOLATE)
	and not ccrPlayerIsMoving()
	then
		-- Cancel double casting if doing Immolate on our Target
		if (ccrTargetHasMyDebuff(IMMOLATE) or ccrTargetHasMyDebuff(IMMOLATE_FB))
		and ccrPlayerIsCastingSpell(IMMOLATE)
		and vLastImmolateGUID == UnitGUID("Target")
		then
			SpellStopCasting()
			return
		end
		
		-- Immolate our Target
		if ccrSpellCanAttack(IMMOLATE)
		and not ccrTargetHasMyDebuff(IMMOLATE)
		and not ccrTargetHasMyDebuff(IMMOLATE_FB)
		and ccrPlayerIsFacingTarget()
		and Target:InLineOfSight()
		then
			ccrCastAttack(IMMOLATE)
			vLastImmolateGUID = UnitGUID("Target")
		end

		-- Immolate ALL is enabled, Find who we have tapped
		-- or is targetting the Player and cast Immolate on them
		if ccRS.Warlock_3_ImmolateAll then
			for x = 0, # tblPGetNearbyEnemies do
				local obj = tblPGetNearbyEnemies[x]
				local vSpell = GetSpellInfo(IMMOLATE)
				if obj
				and obj:Exists()
				and (obj:IsTappedByPlayer() 
				or (obj:GetTarget():Exists() and obj:GetTarget():GetName() == ccrPlayerName()) 
				)
				and obj:InLineOfSight()
				and not ccrUnitHasMyDebuff(obj, vSpell)
				and not ccrUnitHasMyDebuff(obj, IMMOALTE_FB)
				and Player:IsFacing(obj)
				and obj:GetDistance(Player) <= 40
				and not ccrIgnoreNPCWithAura(obj)
				then
					--obj:Target()
					obj:CastSpellByName(GetSpellInfo(IMMOLATE))
					vLastImmolateGUID = obj:GetGUID()
					return
				end
			end
		end
	end
end